package com.example.myapplication.presenter;

import com.example.myapplication.base.BasePresenter;
import com.example.myapplication.bean.HomesBanner;
import com.example.myapplication.bean.HomesListBean;
import com.example.myapplication.model.HomesModel;
import com.example.myapplication.net.ResultCallBack;
import com.example.myapplication.view.HomesView;

public class HomesPresenter extends BasePresenter<HomesView> {

    private HomesModel homesModel;

    @Override
    protected void initModel() {
        homesModel = new HomesModel();
        addModel(homesModel);
    }

    public void getHomesData() {
        homesModel.getHomesData(new ResultCallBack<HomesBanner>() {
            @Override
            public void onSuccess(HomesBanner homesBanner) {
                mView.setData(homesBanner);
            }

            @Override
            public void onFail(String msg) {

            }
        });
    }

    public void getHomesList() {
        homesModel.getHomesList(new ResultCallBack<HomesListBean>() {
            @Override
            public void onSuccess(HomesListBean homesListBean) {
                mView.setListData(homesListBean);
            }

            @Override
            public void onFail(String msg) {

            }
        });
    }
}
